package org.faradel.pharmapp.entities;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.springframework.stereotype.Component;

/**
 * The persistent class for the MedicationOrder database table.
 * 
 */
@Entity
@Table(name = "MedicationOrder")
@Component
public class MedicationOrder implements Serializable
{
    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private int medicationOrderId;

    private int orderId;

    // bi-directional many-to-one association to Medication
    @ManyToOne
    @JoinColumn(name = "Medication_Id")
    private Medication medication;

    @Column(name = "Quantity_ordered")
    private int quantityOrdered;

    public int getQuantityOrdered()
    {
        return quantityOrdered;
    }

    public void setQuantityOrdered(int quantityOrdered)
    {
        this.quantityOrdered = quantityOrdered;
    }

    public MedicationOrder()
    {
    }

    public int getMedicationOrderId()
    {
        return this.medicationOrderId;
    }

    public void setMedicationOrderId(int medicationOrderId)
    {
        this.medicationOrderId = medicationOrderId;
    }

    public int getOrderId()
    {
        return this.orderId;
    }

    public void setOrderId(int orderId)
    {
        this.orderId = orderId;
    }

    public Medication getMedication()
    {
        return this.medication;
    }

    public void setMedication(Medication medication)
    {
        this.medication = medication;
    }

}